

//#if OPENGL
//#if MONOMAC
//using MonoMac.OpenGL;
//using GLPixelFormat = MonoMac.OpenGL.PixelFormat;
//#elif WINDOWS || LINUX
//using System.Drawing.Imaging;
//using OpenTK.Graphics.OpenGL;
//using GLPixelFormat = OpenTK.Graphics.OpenGL.PixelFormat;
//#elif GLES
//using OpenTK.Graphics.ES20;
//using GLPixelFormat = OpenTK.Graphics.ES20.All;
//using TextureTarget = OpenTK.Graphics.ES20.All;
//using TextureParameterName = OpenTK.Graphics.ES20.All;
//using TextureMinFilter = OpenTK.Graphics.ES20.All;
//using PixelInternalFormat = OpenTK.Graphics.ES20.All;
//using PixelType = OpenTK.Graphics.ES20.All;
//using PixelStoreParameter = OpenTK.Graphics.ES20.All;
//using ErrorCode = OpenTK.Graphics.ES20.All;
//#endif
//#elif PSM
//using PssTexture2D = Sce.PlayStation.Core.Graphics.Texture2D;
//#endif


#ifndef Texture2D_h
#define Texture2D_h

#include <Defines.h>
#include <CSharpPropertyMethods.h>

#include <System/Object.h>
#include <System/Nullable.h>
#include <System/IDisposable.h>
#include <System/NotImplementedException.h>
#include <System/ArgumentNullException.h>
#include <System/Math.h>
#include <System/IO/Stream.h>

#include "GraphicsResource.h"
//#include "GraphicsDevice.h"
#include "SurfaceFormat.h"
#include "Texture.h"
#include "../Rectangle.h"

// OpenGL.
//#include "TextureTarget.h"
//#include "TextureUnit.h"

namespace Riccsson
{
	namespace Xna
	{
		namespace Framework
		{
			namespace Graphics
			{
				// Forward decleration.
				class GraphicsDevice;

				class Texture2D
					: public Texture
				{
					private: int _width;
					private: int _height;
					private: static uint _generated_texture_id;
					
					PROP3(Texture2D, int, Width)
					PROP3(Texture2D, int, Height)

					//public: PROP3_GET(Rectangle, Bounds)
					//{
					//	return Rectangle(0, 0, this->Width, this->Height);
					//}

					public: Texture2D(unsigned int glTexture, int width, int height)
						//: this(graphicsDevice, width, height, mipmap, format, false)
						: PROP3_INIT(Texture2D, Width)
						, PROP3_INIT(Texture2D, Height)
					{
						_width = width;
						_height = height;
						GlTexture = glTexture;
					}

					public: Texture2D(GC_PTR<GraphicsDevice> graphicsDevice, int width, int height, bool mipmap, SurfaceFormat format)
						//: this(graphicsDevice, width, height, mipmap, format, false)
						: PROP3_INIT(Texture2D, Width)
						, PROP3_INIT(Texture2D, Height)
					{
						throw; // Implement this() init method.
					}
		
					public: /*internal*/ Texture2D(GC_PTR<GraphicsDevice> graphicsDevice, int width, int height, bool mipmap, SurfaceFormat format, bool renderTarget)
						: PROP3_INIT(Texture2D, Width)
						, PROP3_INIT(Texture2D, Height)
					{
						throw;
					}

			#if PSM
					private: Texture2D(GraphicsDevice graphicsDevice, Riccsson::System::IO::Stream stream)
					{
						throw;
					}
			#endif
				
					public: Texture2D(GC_PTR<GraphicsDevice> graphicsDevice, int width, int height)
						//: this(graphicsDevice, width, height, false, SurfaceFormat.Color, false)
						: PROP3_INIT(Texture2D, Width)
						, PROP3_INIT(Texture2D, Height)
					{
						throw; // Implement this() init method.
					}

					public: PROP3_GET(int, Width)
					{
						return _width;
					}
					private: PROP3_SET(int, Width){throw;}
					
					public: PROP3_GET(int, Height)
					{
						return _height;
					}
					private: PROP3_SET(int, Height){throw;}

					public: template<typename T> void SetData(int level, Riccsson::System::Nullable<Rectangle> rect, Riccsson::System::Array<T>* data, int startIndex, int elementCount) //where T : struct 
					{
						throw;
					}
		
					public: template<typename T> void SetData(Riccsson::System::Array<T>* data, int startIndex, int elementCount) // // where T : struct
					{
						this->SetData(0, null, data, startIndex, elementCount);
					}
		
					public: template<typename T> void SetData(Riccsson::System::Array<T>* data) // where T : struct
					{
						this->SetData(0, null, data, 0, data.Length);
					}
		
					public: template<typename T> void GetData(int level, Riccsson::System::Nullable<Rectangle> rect, Riccsson::System::Array<T>* data, int startIndex, int elementCount) // where T : struct
					{
						throw;
					}

					public: template<typename T> void GetData(Riccsson::System::Array<T>* data, int startIndex, int elementCount) // where T : struct
					{
						this->GetData(0, null, data, startIndex, elementCount);
					}
		
					public: template<typename T> void GetData (Riccsson::System::Array<T>* data) // where T : struct
					{
						this->GetData(0, null, data, 0, data.Length);
					}
		
					public: static GC_PTR<Texture2D> FromStream(GraphicsDevice* graphicsDevice, Riccsson::System::IO::Stream* stream);

					private: void FillTextureFromStream(Riccsson::System::IO::Stream* stream)
					{
						throw;
					}

					public: void SaveAsJpeg(Riccsson::System::IO::Stream* stream, int width, int height)
					{
						throw;
					}

					public: void SaveAsPng(Riccsson::System::IO::Stream* stream, int width, int height)
					{
						throw;
					}

					// This method allows games that use Texture2D.FromStream 
					// to reload their textures after the GL context is lost.
					public: /*internal*/ void Reload(Riccsson::System::IO::Stream* textureStream)
					{
						throw;
					}
				};
			}
		}
	}
}

#endif
